Verb+Noun Parsers and Old School Visual Novels [duplicate]

Posted by user38943 on Game Development See other posts from Game Development or by user38943
Published on 2013-11-12T13:22:49Z Indexed on 2013/11/12 16:00 UTC
Read the original article Hit count: 218

Filed under:

This question already has an answer here:

enter image description here

Hi I'm working on a simple old school visual novel engine in Lua. Basically I have most of the code set up besides one important feature. The Text Parser.

Lets get into how words are generally structured. In the screenshot I input the command "my wish is for you to die"

--How would a human understand this?

my = noun/object

wish = verb

is = connective_equator similar to =

for = connective_object (for all objects of ..)

you = noun/object

to = connective_action similar to do

die = verb

--the computer can then parse this and understand it like this (pseudo example)

my = user

you = get_current_label()

you = "Lost Coatl"

wish = user_command

user_command = for all_objects of "Lost Coatl" do die() end

execute user_command()

What other ways do videogames use text parsers, what would be the simplest way for a newbie coder such as myself?

© Game Development or respective owner

Related posts about lua